package com.cloudfun.campusshare.common.constant;

/**
 * @author linyangping
 * @Title: 应用状态
 * @date 2019/11/6 上午11:28
 */
public enum AppStatus {
    DRAFT(0, "草稿"),
    CREATE_APPLYING(1, "创建审核中"),
    CREATE_APPLY_FAILED(2, "审核未通过"),
    CREATE_APPLY_SUCCESS(3, "创建审核通过"),
    TO_PROD_APPLYING(4, "转生产审核中"),
    TO_PROD_APPLY_FAILED(5, "转生产审核失败"),
    TO_PROD_APPLY_SUCCESS(6, "转生产审核通过");

    private int code;
    private String msg;

    AppStatus(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static String getMsgByCodeInt(int codeInt) {
        for (AppStatus e : AppStatus.values()) {
            if (e.getCode() == codeInt) {
                return e.msg;
            }
        }
        throw new IllegalArgumentException("未定义的code码:" + codeInt);
    }

}
